import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
    {
    title: '标题',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '制度内容',
    align:"center",
    dataIndex: 'content',
    slots: { customRender: 'htmlSlot' },
   },
   {
    title: '发布时间',
    align:"center",
    dataIndex: 'publishTime'
   },
   {
    title: '截止时间',
    align:"center",
    dataIndex: 'endTime'
   },
   {
    title: '附件',
    align:"center",
    dataIndex: 'appendixString'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '标题',
    field: 'title',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入标题!'},
          ];
     },
  },
  {
    label: '制度内容',
    field: 'content',
    component: 'JCodeEditor', //TODO String后缀暂未添加
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入制度内容!'},
          ];
     },
  },
  {
    label: '发布时间',
    field: 'publishTime',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入发布时间!'},
          ];
     },
  },
  {
    label: '截止时间',
    field: 'endTime',
    component: 'Input',
  },
  {
    label: '附件',
    field: 'appendix',
    component: 'JUpload',
    componentProps:{
     }
  },
];
